import weixiao from './weixiao.png' /* 微笑 */
import daxiao from './daxiao.png' /* 撇嘴 */
import daku from './daku.png' /* 色 */
import shengqi from './shengqi.png' /* 发呆 */
import tiaopi from './tiaopi.png' /* 得意 */
import kuxiao from './kuxiao.png' /* 流泪 */
import liuhan from './liuhan.png' /* 害羞 */
import kaixin from './kaixin.png' /* 闭嘴 */
import chijing from './chijing.png' /* 睡 */
import nanguo from './nanguo.png' /* 大哭 */
import haose from './haose.png' /* 尴尬 */
import wuyu from './wuyu.png' /* 发怒 */
import qinqin from './qinqin.png' /* 调皮 */
import deyi from './deyi.png' /* 龇牙 */
import wasai from './wasai.png' /* 惊讶 */
import bianbian from './bianbian.png' /* 囧 */
import keai from './keai.png' /* 抓狂 */
import tushe from './tushe.png' /* 吐 */
import feiwen from './feiwen.png' /* 发笑 */
import kulou from './kulou.png' /* 发笑 */
import tianshi from './tianshi.png' /* 发笑 */
import shuijiao from './shuijiao.png' /* 发笑 */
import hehe from './hehe.png' /* 发笑 */

export const EMOJIS_DATA = {
  '/{weixiao}':weixiao,
  '/{daxiao}': daxiao,
  '/{daku}': daku,
  '/{shengqi}':shengqi,
  '/{tiaopi}': tiaopi,
  '/{kuxiao}': kuxiao,
  '/{liuhan}':liuhan,
  '/{kaixin}': kaixin,
  '/{chijing}': chijing,
  '/{nanguo}': nanguo,
  '/{haose}': haose,
  '/{wuyu}': wuyu,
  '/{qinqin}': qinqin,
  '/{deyi}': deyi,
  '/{wasai}':wasai,
  '/{bianbian}':bianbian,
  '/{keai}': keai,
  '/{tushe}': tushe,
  '/{feiwen}': feiwen,
  '/{kulou}': kulou,
  '/{tianshi}': tianshi,
  '/{shuijiao}': shuijiao,
  '/{hehe}': hehe,
}

// 符号->中文
export const EMOJIS_ZH = {

  '/{weixiao}': '[微笑]',
  '/{daxiao}': '[大笑]',
  '/{daku}': '[大哭]',
  '/{shengqi}': '[生气]',
  '/{tiaopi}': '[得意]',
  '/{kuxiao}': '[哭笑]',
  '/{liuhan}': '[流汗]',
  '/{kaixin}': '[开心]',
  '/{chijing}': '[吃惊]',
  '/{nanguo}': '[难过]',
  '/{haose}': '[色]',
  '/{wuyu}': '[无语]',
  '/{qinqin}': '[亲亲]',
  '/{deyi}': '[得意]',
  '/{wasai}': '[哇噻]',
  '/{bianbian}': '[便便]',
  '/{keai}': '[可爱]',
  '/{tushe}': '[吐舌]',
  '/{feiwen}': '[飞吻]',
  '/{kulou}': '[骷髅]',
  '/{tianshi}': '[天使]',
  '/{shuijiao}': '[睡觉]',
  '/{hehe}': '[呵呵]',
}

export const invertKeyValues = obj =>
  Object.keys(obj).reduce((acc, key) => {
    acc[obj[key]] = key
    return acc
  }, {})

const default_emoji = () => {
  const strMap = new Map()
  let index = 0
  const data = []
  for (const key of Object.keys(EMOJIS_DATA)) {
    strMap.set(key, EMOJIS_DATA[key])
  }
  for (const val of strMap.keys()) {
    data.push({
      key: index,
      value: val
    })
    index++
  }

  const page0 = data.slice(0, 23)
  // const page1 = data.slice(23, 46)
  // const page2 = data.slice(46, 69)
  // const page3 = data.slice(69, 92)
  // const page4 = data.slice(92, 115)

  page0.push({
    key: 100,
    value: '/{del}'
  })
  // page1.push({
  //   key: 101,
  //   value: '/{del}'
  // })
  // page2.push({
  //   key: 102,
  //   value: '/{del}'
  // })
  // page3.push({
  //   key: 103,
  //   value: '/{del}'
  // })
  // page4.push({
  //   key: 104,
  //   value: '/{del}'
  // })
  return [page0]
}

export const DEFAULT_EMOJI = default_emoji()
